// 公共基础接口

import request from '@/utils/request'
import { ILoginInfo, IloginResponse } from './types/common'

// 用户信息
export const getLoginInfo = () => {
  return request<ILoginInfo>({
    method: 'GET',
    url: '/login/info'
  })
}

// 登录成功
export const login = (data: {
  account: string,
  pwd: string,
  imgcode: string
}) => {
  return request<IloginResponse>({
    method: 'POST',
    url: '/login',
    data
  })
}

// 退出登录
export const logout = () => {
  return request({
    method: 'GET',
    url: '/logout'
  })
}
